package symbols;

/**
 * Represents a parameter in a "callable" (aka function, method, sub or predicate call).
 * It is a left-value (aka a variable) which can contain values and references
 * (see call type)
 * 
 * Polymorphism can be used to modify this class' behaviour depending
 * on the call type (by value or by reference).
 * 
 * @author marc
 *
 */
public class SCallableParameter extends SLeftValue {
	boolean byValue = true;	// default call by value, otherwise by reference

	public SCallableParameter(int type, String name) {
		this(type, name, true);
	}
	
	public SCallableParameter(int type, String name, boolean byValue) {
		super(type, name);
		this.byValue = byValue;
	}
	
	public boolean isReference() {
		return !byValue;
	}
	
	public String toString() {
		return byValue?super.toString():"*" + name;
	}
}
